<template>
  <el-dialog
    v-model="visible"
    title="文档预览"
    class="elx-video-dialog"
    top="40px"
    width="1200px"
    :append-to-body="visible"
    @close="() => { type = '' }"
  >
    <pdf-preview
      v-if="type=='pdf'"
      :src="url"
    />
  </el-dialog>
</template>

<script setup>
import pdfPreview from './pdf-preview.vue'

const visible = ref(false)
const type = ref('')
const url = ref('')
const init = (fileType, src) => {
  visible.value = true
  type.value = fileType
  url.value = src
}

defineExpose({
  init
})
</script>

<style lang="scss" scoped>

</style>
